//创建函数式组件
import React ,{ useState }from  'react'


function Child (props){
    const { title } = props;
    
    return (
        <>
        <h2>this is a learning plan two {title} </h2>
        </>
    )
}

function App (){
    const [title, setTitle] = useState('child');
    return (
        <>
           <div>
              <h1>this is a learning plan</h1>
              <Child  title={title} />
              <button onClick= {()=> setTitle('txclass')}>setTitle</button>
           </div>
        </>
    )
  
}

export default App